<%@ page import="raojt.day0109.lotteryProject.dao.LotteryBusinessDao" %>
<%@ page import="raojt.day0109.lotteryProject.dao.impl.LotteryBusinessDaoImpl" %>
<%@ page import="raojt.day0109.tour.entity.TourRoute" %>
<%@ page import="raojt.day0109.tour.dao.impl.TourDaoImpl" %>
<%@ page import="raojt.day0109.tour.dao.TourDao" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 22770
  Date: 2023/1/9
  Time: 19:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>删除旅游路线信息</title>
    <%
        request.setCharacterEncoding("UTF-8");
        String name = request.getParameter("name");
        Map<String, Object> map = new HashMap<>();
        String id = "";
        map.put("tourRouteName",name);
        TourDao tourDao = new TourDaoImpl();
        List<TourRoute> tourRouteList = tourDao.selectTourRouteAll(map);
        for (TourRoute tr:tourRouteList){
            id= tr.getId();
        }
        int deleteRes = tourDao.deleteTourRouteById(id);
        if (deleteRes > 0){
            //跳转到index.jsp页面
            //转发 和 重定向
            request.getRequestDispatcher("index.jsp").forward(request,response);
        }else{
            out.print("删除失败");
        }
    %>
</head>
<body>

</body>
</html>
